using System;
using Prometheus.TypeUtility;

#if SILVERLIGHT
#endif

namespace Prometheus.Binding.ReadOnly.BaseConverters
{
    public class proImageSourceConverter : proChainConverter
    {

        public override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var bytes = value as byte[];
            if (bytes != null)
                return bytes.ConvertToImageSource();

            return null;
        }

        public override object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotSupportedException();
        }
    } 

}